package com.triz.business.service.impl;

import java.util.List;
import java.util.Map;

import com.triz.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.triz.business.mapper.ComponentInteractionMapper;
import com.triz.business.domain.ComponentInteraction;
import com.triz.business.service.IComponentInteractionService;

/**
 * 组件相互作用力关系Service业务层处理
 * 
 * @author hlk
 * @date 2025-11-14
 */
@Service
public class ComponentInteractionServiceImpl implements IComponentInteractionService 
{
    @Autowired
    private ComponentInteractionMapper componentInteractionMapper;

    /**
     * 查询组件相互作用力关系
     * 
     * @param id 组件相互作用力关系主键
     * @return 组件相互作用力关系
     */
    @Override
    public ComponentInteraction selectComponentInteractionById(Long id)
    {
        return componentInteractionMapper.selectComponentInteractionById(id);
    }

    /**
     * 查询组件相互作用力关系列表
     * 
     * @param componentInteraction 组件相互作用力关系
     * @return 组件相互作用力关系
     */
    @Override
    public List<ComponentInteraction> selectComponentInteractionList(ComponentInteraction componentInteraction)
    {
        return componentInteractionMapper.selectComponentInteractionList(componentInteraction);
    }

    /**
     * 新增组件相互作用力关系
     * 
     * @param componentInteraction 组件相互作用力关系
     * @return 结果
     */
    @Override
    public int insertComponentInteraction(ComponentInteraction componentInteraction)
    {
        componentInteraction.setCreateTime(DateUtils.getNowDate());
        return componentInteractionMapper.insertComponentInteraction(componentInteraction);
    }

    /**
     * 修改组件相互作用力关系
     * 
     * @param componentInteraction 组件相互作用力关系
     * @return 结果
     */
    @Override
    public int updateComponentInteraction(ComponentInteraction componentInteraction)
    {
        componentInteraction.setUpdateTime(DateUtils.getNowDate());
        return componentInteractionMapper.updateComponentInteraction(componentInteraction);
    }

    /**
     * 批量删除组件相互作用力关系
     * 
     * @param ids 需要删除的组件相互作用力关系主键
     * @return 结果
     */
    @Override
    public int deleteComponentInteractionByIds(Long[] ids)
    {
        return componentInteractionMapper.deleteComponentInteractionByIds(ids);
    }

    /**
     * 删除组件相互作用力关系信息
     * 
     * @param id 组件相互作用力关系主键
     * @return 结果
     */
    @Override
    public int deleteComponentInteractionById(Long id)
    {
        return componentInteractionMapper.deleteComponentInteractionById(id);
    }

    @Override
    public void deleteInteractionByProjectId(Map<String, Object> map) {
        componentInteractionMapper.deleteInteractionByProjectId(map);
    }

    @Override
    public int saveInteractionRelations(List<ComponentInteraction> list) {
        return componentInteractionMapper.saveInteractionRelations(list);
    }
}
